import request from '@/api/request.js'

function addressList(data){
	return request({
		url: '/lejuClient/address/findAllAddress',
		method: 'get',
		data
	})
}
function addressSave(data){
	return request({
		url: '/api/leju/front/address/save',
		method: 'post',
		data
	})
}
function detail(data){
	return request({
		url: '/api/leju/front/address/detail',
		method: 'get',
		data
	})
}
function addressUpdate(data){
	return request({
		url: '/api/leju/front/address/update',
		method: 'post',
		data
	})
}



// 新增收获地址

function addAddressInfo(data){
	return request({
		url: '/lejuClient/address/addAddressInfo',
		method: 'post',
		data
	})
}

// 删除收获地址

function delAddressInfo(id,data){
	return request({
		url: `/lejuClient/address/delAddressInfo/${id}`,
		method: 'delete',
		data
	})
}

// 更新收获地址

function updateAddressInfo(data){
	return request({
		url: '/lejuClient/address/updateAddressInfo',
		method: 'post',
		data
	})
}

// 切换默认选中
function switchDefault(id,status){
	return request({
		url: `/lejuClient/address/switchDefault/${id}/${status}`,
		method: 'post'
	})
}
export default {
    addressList,
    addressSave,
	detail,
	addressUpdate,
	addAddressInfo,
	delAddressInfo,
	updateAddressInfo,
	switchDefault
}